/**  
*
* <p>CustomToken.java</p>  
* <p>Copyright: Copyright (c) 2020</p>  
* <p>Company: http://www.richfit.com/</p>  
* @author hushouquan
* @date 2020年5月20日  
* @version 1.0  
*/  
package com.rf.richfitwheel.admin.contants;

import org.apache.shiro.authc.UsernamePasswordToken;

import com.rf.richfitwheel.common.contants.Constant.LoginType;;

/**  
* 
* @author hushouquan
* @date 2020年5月20日  
*/
public class CustomToken extends UsernamePasswordToken {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -3806905241192753453L;

	private LoginType type;

	/**
	 * 当前登录的终端 {@link com.rf.richfitwheel.common.contants.Constant.TerminalType}
	 */
	private String terminal;
	
	/**
	 * 租户
	 */
	private String tenantId;

	public CustomToken() {
	    super();
	}
	
	
	public CustomToken(String username, String password, LoginType type, boolean rememberMe, String host) {
	    super(username, password, rememberMe,  host);
	    this.type = type;
	}
	/**免密登录*/
	public CustomToken(String username) {
	    super(username, "", false, null);
	    this.type = LoginType.NOPASSWD;
	}
	/**账号密码登录*/
	public CustomToken(String username, String pwd) {
	    super(username, pwd, false, null);
	    this.type = LoginType.PASSWORD;
	}
	
	public CustomToken(String username, String password, LoginType type, boolean rememberMe, String host, String tenantId) {
	    super(username, password, rememberMe,  host);
	    this.type = type;
	    this.tenantId = tenantId;
	}
	/**免密登录*/
	public CustomToken(String username, boolean pwd, String tenantId) {
	    super(username, "", false, null);
	    this.type = LoginType.NOPASSWD;
	    this.tenantId = tenantId;
	}
	/**账号密码登录*/
	public CustomToken(String username, String pwd, String tenantId) {
	    super(username, pwd, false, null);
	    this.type = LoginType.PASSWORD;
	    this.tenantId = tenantId;
	}
	
	public LoginType getType() {
	    return type;
	}
	
	
	public void setType(LoginType type) {
	    this.type = type;
	}

	public String getTerminal() {
		return terminal;
	}

	public void setTerminal(String terminal) {
		this.terminal = terminal;
	}


	public String getTenantId() {
		return tenantId;
	}


	public void setTenantId(String tenantId) {
		this.tenantId = tenantId;
	}
}
